package com.daisuxia.web.dao;

import java.util.HashMap;
import java.util.List;

import com.daisuxia.web.pojo.BorrowOrder;
import com.daisuxia.web.pojo.RiskCreditUser;

public interface IBorrowOrderDao {
    int deleteByPrimaryKey(Integer id);

    int insert(BorrowOrder record);

    int insertSelective(BorrowOrder record);

    BorrowOrder selectByPrimaryKey(Integer id);
    BorrowOrder selectByOutTradeNo(String outTradeNo);
    BorrowOrder selectByParam(HashMap<String, Object> params);
    
    List<BorrowOrder> findParams(HashMap<String, Object> params);
    
    int updateByPrimaryKeySelective(BorrowOrder record);

    int updateByPrimaryKeyWithBLOBs(BorrowOrder record);

    int updateByPrimaryKey(BorrowOrder record);
    
    int insertRiskUser(RiskCreditUser risk);
    int updateRiskCreditUserById(com.daisuxia.risk.pojo.RiskCreditUser   riskCreditUser);
    int findParamsCount(HashMap<String, Object> params);
	BorrowOrder selectBorrowOrderUseId(Integer userId);
	BorrowOrder selectBorrowOrderNowUseId(Integer userId);
	/**
	 * 根据用户查询申请列表
	 * @param userId
	 * @return
	 */
	List<BorrowOrder> findByUserId(Integer userId);
	
    /**
     * 查询当前用户最近一次申请借款审核失败的订单
     * @param params
     * @return
     */
	BorrowOrder findAuditFailureOrderByUserId(HashMap<String,Object> params);
}